<?php
include_once('./getAccesstoken.php');
$ticket_url='https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token='.$access_token;
$expire_seconds=10*60;
$action_name='QR_SCENE';
$action_info['scene']['scene_id']='1';
$data['expire_seconds']=$expire_seconds;
$data['action_name']=$action_name;
$data['action_info']=$action_info;
$postData=json_encode($data);
$ticket_ret=http_curl($ticket_url,$postData);//获取ticket
$ticket_msg=json_decode($ticket_ret);
$ticket=urlencode($ticket_msg->ticket);
$qrcode_url='https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket='.$ticket;
var_dump($qrcode_url);exit;
$qrcode=http_curl($qrcode_url);//获取二维码
var_dump($qrcode);exit;
